package stringexercise;

public class StringBuiderDemo2 {
    public static void main(String[] args) {
        String str="好好学java";
        StringBuilder builder=new StringBuilder(str);//把字符串改为builder类型
        builder.append(",为了高薪工作");
        System.out.println(builder);

        builder.replace(8,14,"为了生活");
        System.out.println(builder);

        builder.delete(0,7);
        System.out.println(builder);

        builder.insert(0,"活着");
        System.out.println(builder);

    }





}
